Simultaneous-edit protection for workspace files#1949
Merged
AaronPlave merged 8 commits intoJul 9, 2026
Conversation
dandelany
reviewed
Jul 1, 2026
dandelany
left a comment
Collaborator
There was a problem hiding this comment.
Tested locally with @AaronPlave and this is working well. A few notes below - mostly handling edge cases and small style things.
7b4a62c to
42cdf53
Compare
dandelany
approved these changes
Jul 8, 2026
dandelany
left a comment
Collaborator
There was a problem hiding this comment.
Re-tested latest changes with @AaronPlave - all works as expected, ready to merge!
…lict modal - Rename reqWorkspaceWithMeta -> reqWorkspaceWithEtag (+ return type) to avoid confusion with reqWorkspaceMetadata - Rename the opaque "token" vocabulary to "etag" across the activeDocument store (baseToken -> baseEtag), modal resolution, effects, and consumers - Redesign WorkspaceSaveConflictModal: gray footer bar with white "Keep theirs / Keep mine" buttons, per-action consequence sublines, and a "Keep editing" escape; unify the conflict / deleted / load-error footers - Show an "N changed lines" summary in the diff header (emitted from the diff viewer) - Deleted variant: destructive text cue on "Discard & close" + "Recreate file", each with a consequence subline - Re-fetch the latest server version when the user picks "Keep theirs" so it never applies a stale snapshot from when the modal opened - Make "Keep theirs" undoable: rebaseContent() on both editors records the rebase in the undo history so Cmd-Z restores the discarded edits - Add e2e coverage for the undo behavior; update conflict fixture selectors/labels
42cdf53 to
a093d3f
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



___REQUIRES_AERIE_PR___="1836"Summary
Implements simultaneous edit protection for workspace files. Closes #1789 and will make a followup issue for auto-save. Previously, two people editing the same workspace file could silently overwrite each other. Now, if a file changed since you opened it, saving shows you a diff in a modal and lets you choose which version to keep (yours, theirs, or cancel). This PR also fixes a related bug where "read-only" files could still be edited through the syntax highlighting diagnostic auto-fix buttons and the right tab command panel inputs.
Backend PR here: NASA-AMMOS/plandev#1836, details the approach for edit protections using HTTP
ETagandIf-Matchheaders.Details
@codemirror/merge). The modal handles the file being changed, deleted/moved, or temporarily unreachable — the last one never offers a destructive option.Visible UX Changes
or Keep editing. Keeping theirs is undoable (cmd/ctrl-z restores your discarded edits).
Verification
src/stores/activeDocument.test.tssrc/utilities/codemirror/readOnly.test.tssrc/utilities/requests.test.tssrc/utilities/workspaces.test.tse2e-tests/tests/workspace-edit-protection.tse2e-tests/tests/workspace.test.ts